<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <table id="table">
    </table>
<script>
    var title = new Array('员工编号','员工岗位','基本工资')
    var emloyees = [['YF01','高级工程师','9000'],['YF02','程序员','5000']]
    /*用js实现：先往emloyees中添加一组数据,(YF03,测试员,3500),
    然后将2个数组中的数据，以表格的形式呈现在页面中。*/
    emloyees.push(['YF03','测试员','3500'])
    var table = document.getElementById('table');
    var headerRow = table.insertRow(0);

    for (var i = 0; i < title.length; i++) {
        var cell = headerRow.insertCell(i);
        cell.innerHTML = title[i];
    }
    for (var i = 0; i < emloyees.length; i++) {
        var row = table.insertRow(i + 1);
        for (var j = 0; j < emloyees[i].length; j++) {
            var cell = row.insertCell(j);
            cell.innerHTML = emloyees[i][j];
        }
    }

</script>
</body>
</html>
